﻿<%@ Page Title="" Language="C#" MasterPageFile="~/main.Master" AutoEventWireup="true"
    CodeBehind="NoticiasCadastro.aspx.cs" Inherits="Presentation.Pages.NoticiasCadastro" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#txtData").mask("99/99/9999");
        }); 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>
        Cadastro de Notícias
    </h1>
    <table>
        <tr>
            <td class="style1">
                <asp:Label ID="Label1" runat="server" Text="Título :"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtTitulo" MaxLength="200" runat="server" Width="231px" BorderColor="#0099FF"
                    BorderStyle="Solid" BorderWidth="1"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvTitulo" runat="server" Display="Dynamic" ControlToValidate="txtTitulo"
                    ErrorMessage="Título." ToolTip="Campo Obrigatório." ValidationGroup="Salvar">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <span style="color:Red">Para abrir uma tag < utilize "__". Para fechar utilize "--"</span>
            </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label2" runat="server" Text="Data :"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtData" runat="server" Width="231px" MaxLength="10" BorderColor="#0099FF"
                    BorderStyle="Solid" BorderWidth="1" ClientIDMode="Static"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvData" runat="server" Display="Dynamic" ControlToValidate="txtData"
                    ErrorMessage="Data." ToolTip="Campo Obrigatório." ValidationGroup="Salvar">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style1" valign="top">
                <asp:Label ID="Label3" runat="server" Text="Corpo HTML :"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtCorpoHTML" runat="server" Width="379px" MaxLength="5" BorderColor="#0099FF"
                    BorderStyle="Solid" BorderWidth="1" Height="158px" TextMode="MultiLine"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCorpoHTML" runat="server" Display="Dynamic" ControlToValidate="txtCorpoHTML"
                    ErrorMessage="Corpo HTML." ToolTip="Campo Obrigatório." ValidationGroup="Salvar">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right">
                <asp:Button ID="btnSalvar" runat="server" Text="Salvar" ValidationGroup="Salvar"
                    OnClick="btnSalvar_Click" />
                <asp:ValidationSummary ID="vSum" runat="server" HeaderText="Favor verificar os seguintes campos :"
                    ShowMessageBox="True" ShowSummary="False" ValidationGroup="Salvar" />
            </td>
        </tr>
    </table>
    <br />
    <br />
    <h1>
        Lista de Notícias
    </h1>
    <asp:GridView ID="grvNoticias" runat="server" AutoGenerateColumns="False" CellPadding="4"
        ForeColor="#333333" GridLines="None" Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="Titulo" HeaderText="Titulo" ReadOnly="True">
                <ControlStyle Width="30%" />
                <HeaderStyle Width="30%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Data" HeaderText="Data" ReadOnly="True" DataFormatString="{0:dd/MM/yyyy}">
                <ControlStyle Width="30%" />
                <HeaderStyle Width="30%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:CheckBoxField DataField="Ativo" HeaderText="Ativo" SortExpression="Ativo" />
            <asp:TemplateField HeaderText="Adicionar Foto">
                <HeaderStyle Width="20%" HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:Button Text="Adicionar Foto" CommandArgument='<%# Eval("Codigo") %>' runat="server"
                        ID="btnAdicionarFoto" OnClick="btnAdicionarFoto_Click" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Ativar/Desativar">
                <HeaderStyle Width="20%" HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:Button Text="Ativar/Desativar" CommandArgument='<%# Eval("Codigo") %>' runat="server"
                        ID="btnAtivarDesativar" OnClick="btnAtivarDesativar_Click" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
</asp:Content>
